import request from '@/utils/request'

// 根据id查询用户记录
export const getUserById = (id) =>
  request({
    url: `/sys/user/${id}`,
    method: 'get'
  })

// 分页查询用户列表
export const listUserPage = (search) =>
  request({
    url: '/sys/user/list',
    method: 'post',
    data: search
  })

// 查询所有用户记录
export const listUserAll = (search) =>
  request({
    url: '/sys/user/listAll',
    method: 'post',
    data: search
  })

// 保存/更新用户记录
export const saveUser = (user) =>
  request({
    url: '/sys/user/save',
    method: 'post',
    data: user
  })

// 删除用户记录
export const deleteUser = (user) =>
  request({
    url: '/sys/user/delete',
    method: 'post',
    data: user
  })

// 批量保存用户记录
export const bulkInsertUser = (users) =>
  request({
    url: '/sys/user/bulkInsert',
    method: 'post',
    data: users
  })

// 批量更新用户记录
export const bulkUpdateUser = (users) =>
  request({
    url: '/sys/user/bulkUpdate',
    method: 'post',
    data: users
  })

// 批量删除用户记录
export const bulkDeleteUser = (users) =>
  request({
    url: '/sys/user/bulkDelete',
    method: 'post',
    data: users
  }) 